package com.xdq.serviceedu.utils;

import org.springframework.web.context.request.RequestAttributes;

public class RequestAttributeContext {
    private static final ThreadLocal<RequestAttributes> context = new InheritableThreadLocal<>();
    public static void setAttribute(RequestAttributes attributes) {
        if (null == attributes) {
            System.out.println("RequestAttributeContext.setAttribute   RequestAttributes is null");
        }
        context.set(attributes);
    }
    public static RequestAttributes getAttribute() {
        return context.get();
    }
    public static void removeAttribute() {
        context.remove();
    }
}
